<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //windwo-全局作用域对象
        var a = 10

        //this指向当前对象的指针
        //谁调用这个函数。this就指向谁
        var obj = {
            a: 100,
            b: 200,
            func: function (arg1, arg2) {
                console.log(arg1)
                console.log(arg2)
                // console.log(this)
                // console.log(this.a) //window.a
            }
        }

        // obj.func(100,200)

        var newFunc = obj.func
        //newFunc.call(obj,100,200)
        newFunc.apply(obj, [100, 200])

        //call apply bind 

        newFunc()
        // window.newFunc()
    </script>
</body>

</html>